package cn.edu.bupt.scidata.service.impl;

import cn.edu.bupt.scidata.mapper.PaperkeyMapper;
import cn.edu.bupt.scidata.model.paper.Paper;
import cn.edu.bupt.scidata.service.PaperkeyService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaperkeyServiceImpl implements PaperkeyService {
    @Autowired
    PaperkeyMapper paperkeyMapper;

    @Override
    public List<Paper> querypaper(int keyid) {
        return paperkeyMapper.querypaper( keyid);
    }

    @Override
    public List<Paper> querypaperpage(int keyid, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return paperkeyMapper.querypaper(keyid);
    }

    @Override
    public PageInfo<Paper> querypaperpagef(int keyid, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Paper> lists = paperkeyMapper.querypaper(keyid);
        return new PageInfo<Paper>(lists);
    }
}
